import {
  defineStore
} from "pinia";
const startDate = new Date()
const endDate = new Date()
endDate.setDate(startDate.getDate() + 1)
import {
  getAssetURL
} from "@/utils/load_assets.js"
const useMainStore = defineStore("main", {
  state: () => ({
    token: "",
    userInfo: {
      avatar: getAssetURL('home/avatar.png'),
      name: '登录',
      service: '',
      is_wx: 0, //默认是0未绑定openid，当为1的时候为绑定过的状态
    },
    startDate: startDate,
    endDate: endDate,
    dataCounts: { //数据统计
      kabaw_count: '',
      order_count: '',
      money: ''
    },
    isLoading: false
  })
})

export default useMainStore